Skip to content

feat(agent): bound, isolate, and account for every drive - #31

Merged
tcballard merged 3 commits into
mainfrom
claude/resilience
Jul 2, 2026
Merged

feat(agent): bound, isolate, and account for every drive#31
tcballard merged 3 commits into
mainfrom
claude/resilience

Conversation

@tcballard

@tcballard tcballard commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Batch 3 of the technical-review fixes. Stacked on #30 (→ #29) — merge in order; GitHub retargets automatically.

Nothing in the pipeline bounded wall-clock time or spend, and one failure could destroy unrelated work: a stalled model/shell/Playwright/rac process hung forever, one transient model 500 aborted a capability, a throwing drive rejected the scoped pool and discarded every sibling's completed result, and a runner exception aborted the fidelity gate.

What

  • Every external await is time-boxed. Model calls get a wall-clock cap (default 2 min, modelTimeoutMs) plus one backed-off retry on transient failure — the final error names both failures. runCommand gets timeout/maxBuffer (2 min / 16 MB), mirrored in the emitted spec's inline helper so record and replay stay in agreement. The Playwright invocation (10 min, configurable), the rac graph export (2 min), and the git diff (1 min) get execFile timeouts.
  • Failure is local. A runner exception during the fidelity gate counts as a failed attempt with its reason on FidelityVerdict.errors — "the test failed" and "the run broke" are now distinguishable, and the gate always completes its N attempts. The scoped pool wraps each capability's whole runQa in try/catch, filling the existing ScopedCapabilityResult.error seam — siblings' results survive.
  • Bounded observation. Text and ARIA blocks are clipped at 8,000 chars/turn with an explicit [truncated N chars] marker, so a content-heavy page can't grow the transcript quadratically.
  • Visible cost and conduct. Both adapters surface provider token usage (ModelResponse.usage), the drive accumulates it into DriveResult.tokens (shown in the QA summary), and --verbose streams a per-turn audit trail — tool calls, errors, model latency — to stderr as it happens.

All additive: no verdict semantics change, every existing caller compiles unchanged.

Corpus (dogfood)

req-drive-resilience + design-drive-resilience, roadmap initiative, ## Verified By → the four pinning test files. Gates green: rac validate (33/33), relationships 48/48 (0 issues), self-coverage 16/16.

Verification

  • Unit: 298 passed (14 new — retry/timeout/dead-provider, gate error attempts, pool isolation, observation clipping, adapter usage mapping, onStep audit, hung-command timeout).
  • Real browser (PROOFKEEPER_E2E=1): drive, qa, terminal, and http integration suites pass.
  • npm run typecheck / build green.

tcballard added 3 commits July 1, 2026 22:26
…onomous-qa-enhancements]

Nothing in the pipeline bounded wall-clock time or spend, and one
failure could destroy unrelated work:

- time-box every external await: model calls (with a single backed-off
  retry on transient failure), runCommand (timeout + maxBuffer,
  mirrored in the emitted spec's inline helper), the Playwright
  invocation, the rac graph export, and the git diff
- a runner exception during the fidelity gate is a failed attempt with
  its reason on FidelityVerdict.errors, never an abort
- a scoped capability's throw becomes its own error entry; sibling
  results are no longer discarded by a rejected pool
- observation text/ARIA blocks are capped per turn with an explicit
  truncation marker
- adapters surface provider token usage, the drive accumulates it into
  DriveResult.tokens (shown in the QA summary), and --verbose streams a
  per-turn audit trail to stderr

Signed-off-by: Tom Ballard <tom@armytage.co>
…roadmap:autonomous-qa-enhancements]

Pins that a stalled model call errors at its cap, a transient failure
is retried once (and a dead provider reports both errors), runner
exceptions count as failed fidelity attempts with reasons, a throwing
capability never discards scoped siblings, oversized observations are
clipped with a marker, both adapters map provider usage, onStep emits
the per-turn audit record, and a hung command errors within its cap.

Signed-off-by: Tom Ballard <tom@armytage.co>
…dmap:autonomous-qa-enhancements]

Implements lore-proofkeeper/requirements/req-drive-resilience.md.

Adds the requirement and design artifacts, the roadmap initiative, and
the changelog entry.

Signed-off-by: Tom Ballard <tom@armytage.co>
@tcballard
tcballard changed the base branch from claude/verified-semantics to main July 2, 2026 04:38
@tcballard
tcballard merged commit a0f4bb7 into main Jul 2, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant